//
//  WTDetailHeadView.m
//  OneDay
//
//  Created by lanou on 16/1/12.
//  Copyright © 2016年 小明. All rights reserved.
//

#import "WTDetailHeadView.h"

#define kMargin 10 *  kRelativeLength_X
#define kTitleLabelHeight 60 *  kRelativeLength_X
#define kLabelHeight 20 *  kRelativeLength_X

@implementation WTDetailHeadView

- (instancetype)initWithFrame:(CGRect)frame

{
    self = [super initWithFrame:frame];
    if (self) {
        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(kMargin, kMargin, kScreenWidth - kMargin * 2, kTitleLabelHeight)];
        _titleLabel.numberOfLines = - 1;
        _titleLabel.font = [UIFont systemFontOfSize:22];
        [self addSubview:_titleLabel];
        
        
        _authorNameLabel = [[UILabel alloc]initWithFrame:CGRectMake(_titleLabel.left, _titleLabel.bottom + kMargin, 200 * kRelativeLength_X, kLabelHeight)];
        [self addSubview:_authorNameLabel];
        
        
        _publishTimeLabel = [[UILabel alloc]initWithFrame:CGRectMake(kScreenWidth - 100 * kRelativeLength_X - kMargin, _authorNameLabel.top, 100 * kRelativeLength_X, _authorNameLabel.height)];
        _publishTimeLabel.font = [UIFont systemFontOfSize:14];
        _publishTimeLabel.textAlignment = NSTextAlignmentRight;
        [self addSubview:_publishTimeLabel];
        
        UIImageView *imageV = [[UIImageView alloc]initWithFrame:CGRectMake(_titleLabel.left, self.height - 1, kScreenWidth - 2 * kMargin, 1)];
        imageV.backgroundColor = [UIColor grayColor];
        [self addSubview:imageV];
       
        
    }
    return self;
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
